<template>
  <keep-alive :include="cacheViews">
    <router-view :key="key"> </router-view>
  </keep-alive>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  // KeepAliveComponent
  name: 'KeepAliveComponent',

  components: {},

  props: {},

  data() {
    return {}
  },

  computed: {
    ...mapGetters(['cacheViews']),

    key() {
      if (this.$route.meta.level > 1) {
        return this.$route.matched[1].path
      } else {
        return this.$route.path
      }
    }
  },

  watch: {},

  created() {},

  mounted() {},

  methods: {}
}
</script>

<style lang="scss" scoped></style>
